package sim;

public class Constants
{
	public static final int[][] woundChart =
	{
	{ 4, 5, 6, 6, 0, 0, 0, 0, 0, 0 },
	{ 3, 4, 5, 6, 6, 0, 0, 0, 0, 0 },
	{ 2, 3, 4, 5, 6, 6, 0, 0, 0, 0 },
	{ 2, 2, 3, 4, 5, 6, 6, 0, 0, 0 },
	{ 2, 2, 2, 3, 4, 5, 6, 6, 0, 0 },
	{ 2, 2, 2, 2, 3, 4, 5, 6, 6, 0 },
	{ 2, 2, 2, 2, 2, 3, 4, 5, 6, 6 },
	{ 2, 2, 2, 2, 2, 2, 3, 4, 5, 6 },
	{ 2, 2, 2, 2, 2, 2, 2, 3, 4, 5 },
	{ 2, 2, 2, 2, 2, 2, 2, 2, 3, 4 } };

	public static final int[][] assaultHitChart =
	{
	{ 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 },
	{ 3, 4, 4, 4, 5, 5, 5, 5, 5, 5 },
	{ 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 },
	{ 3, 3, 3, 4, 4, 4, 4, 4, 5, 5 },
	{ 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 },
	{ 3, 3, 3, 3, 3, 4, 4, 4, 4, 4 },
	{ 3, 3, 3, 3, 3, 3, 4, 4, 4, 4 },
	{ 3, 3, 3, 3, 3, 3, 3, 4, 4, 4 },
	{ 3, 3, 3, 3, 3, 3, 3, 3, 4, 4 },
	{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 4 } };

	public static final int[] shootingHitChart =
	{ 6, 5, 4, 3, 2, 2, 2, 2, 2, 2 };

	/**
	 * Checks the woundChart and returns the value
	 * 
	 * @param strength
	 *            value 1-10
	 * @param toughness
	 *            value 1-10
	 * @return value that must be rolled >= in order to pass test
	 */
	public static int getWoundResult(int toughness, int strength)
	{
		return woundChart[strength - 1][toughness - 1];
	}

	/**
	 * Checks the assaultHitChart and returns the value
	 * 
	 * @param defender
	 *            value 1-10 of defender's WS.
	 * @param attacker
	 *            value 1-10 of attackers WS.
	 * @return roll to be >= to pass assualt hit test.
	 */
	public static int getAssaultHitResult(int defender, int attacker)
	{
		return assaultHitChart[attacker - 1][defender - 1];
	}
}
